__author__ = 'sha66y'

import datetime
from backtest import Backtest
from data import HistoricCSVDataHandler
from execution import SimulatedExecutionHandler
from portfolio import Portfolio
from intraday_mr import IntradayOLSMRStrategy

if __name__ == "__main__":
    csv_dir = './data/' # CHANGE THIS TO YOUR DATA PATH!
    symbol_list = ['AREX', 'WLL']
    initial_capital = 100000.0
    heartbeat = 0.0 # No heartbeat, since we're backtesting

    # 8th November 2007, 10:41:00 AM
    start_date = datetime.datetime(2007, 11, 8, 10, 41, 0)

    backtest = Backtest(
        csv_dir, symbol_list, initial_capital, heartbeat, start_date,
        HistoricCSVDataHandler, SimulatedExecutionHandler,
        Portfolio, IntradayOLSMRStrategy
    )
    backtest.simulate_trading()
